package com.aaa.service;

import com.aaa.dao.StudentDao;
import com.aaa.entity.Student;
import com.aaa.vo.Result;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: qy173-springboot03
 * @description:
 * @author: 闫克起
 * @create: 2024-04-16 17:04
 **/
@Service
public class StudentService {
    @Autowired
    private StudentDao studentDao;

    public Result findAll(Integer current,Integer pageSize){
        PageHelper.startPage(current,pageSize);
        List<Student> students = studentDao.selectAll();
        PageInfo<Student> pageInfo=new PageInfo<>(students);
        return new Result(200,"查询成功",pageInfo);
    }
}
